import request from '@/utils/request'

// 查询预开票列表
export function listPreInvoice(query) {
  return request({
    url: '/training/preInvoice/list',
    method: 'get',
    params: query
  })
}

// 查询预开票详细
export function getPreInvoice(preInvoiceId) {
  return request({
    url: '/training/preInvoice/' + preInvoiceId,
    method: 'get'
  })
}

// 新增预开票
export function addPreInvoice(data) {
  return request({
    url: '/training/preInvoice',
    method: 'post',
    data: data
  })
}

// 修改预开票
export function updatePreInvoice(data) {
  return request({
    url: '/training/preInvoice',
    method: 'put',
    data: data
  })
}

// 删除预开票
export function delPreInvoice(preInvoiceId) {
  return request({
    url: '/training/preInvoice/' + preInvoiceId,
    method: 'delete'
  })
}



// 预开票列表
export function getList(query) {
  return request({
    url: '/training/preInvoice/getList',
    method: 'get',
    params: query
  })
}


// 关联报名信息
export function associationRegistration(data) {
  return request({
    url: '/training/preInvoice/associationRegistration',
    method: 'put',
    data: data
  })
}


//退换票详细信息查询
export function getRefundInfo(preInvoiceId) {
  return request({
    url: '/training/preInvoice/getRefundInfo/' + preInvoiceId,
    method: 'get'
  })
}

//关联发票--报名信息回显
export function getCorrelationInfo(preInvoiceId) {
  return request({
    url: '/training/preInvoice/getCorrelationInfo/' + preInvoiceId,
    method: 'get'
  })
}